package de.jonasjelten.jcalc.parser;

import de.jonasjelten.jcalc.exception.JParserException;
import de.jonasjelten.jcalc.mathExps.JMathExp;
import de.jonasjelten.jcalc.mathExps.JPrimeTest;
import java.util.Arrays;
import java.util.List;

/**
 * Primzahlentest
 * @author Jonas Jelten
 */
public class JPrimeTestParser extends JExpressionParser {

    @Override
    public JMathExp parseExpression(String[] expression) throws JParserException {
        return new JPrimeTest(parser.doDeepSolve(expression[0], 0));
    }

    @Override
    public List<String> getExpressionAliases() {
        return Arrays.asList(new String[] {"isprime", "primetest"});
    }

}
